package org.jeecg.modules.vx.student.util;

import java.util.Map;

public class EmptyUtil {
    /*
     * 字符串非空验证
     * */
    public static boolean isEmptyStr(final String str){
        return str==null || "".equals(str.trim());
    }

    /*
     * 对象非空验证
     * */
    public static <T> boolean isEmptyObj(final T str){
        return str==null||"".equals(str.toString());
    }

    /*
     * map非空验证
     * */
    public static boolean isEmptyMap(final Map map){
       return  map == null || map.isEmpty();
    }

    /*
    * 验证Stringbuffer是否为空
    * */
    public static boolean isEmptyStrBuffer(final StringBuffer stringBuffer){
        return  stringBuffer == null ||"".equals(stringBuffer.toString())  || stringBuffer.length() == 0;
    }

    /*
    * 验证Obj数组是否为空
    * */
    public static boolean isEmptyObjArr(final Object[] obj){
        return  (obj == null) || (obj.length == 0);
    }

    /*
    * 验证long类型是否为空
    * */
    public static boolean isEmptyLong(Long longTime) {
       return (longTime == null) || (longTime.longValue() <= 0L);
    }

    /*
    * 验证String数组是否为空
    * */
    public static boolean isEmptyStrArr(String[] str) {
        return (str == null) || (str.length == 0);
    }


}
